package com.jinsi.mapper.ylt;

import com.jinsi.pojo.SyDiscountsIssuance;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName UserCouponMapper
 * @Content 用户优惠券持久层
 * @Author 姚龙腾
 * @Date 2022/10/12 11:53
 */
@Mapper
public interface UserCouponMapper {


    /**
     * 获取所有用户优惠劵信息
     * @param userAccount
     * @param userName
     * @return List<SyDiscountsIssuance>
     */
    List<SyDiscountsIssuance> getAll(String userAccount,String userName);

    /**
     * 获取优惠劵剩余数量
     * @param discountsId
     * @return int
     */
    @Select("select discounts_amount from sy_discounts where discounts_id = #{discountsId}")
    int getCouponNum(Integer discountsId);




}
